USE [BillManage]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[Bill_Product](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[FCid] [int] NOT NULL,
	[FName] [varchar](200) NOT NULL,
	[FCName] [varchar](50) NULL,
	[FBillNo] [varchar](50) NOT NULL,
	[FVerifyCode] [varchar](50) NOT NULL,
	[FItem1] [varchar](50) NULL,
	[FUnit1] [varchar](50) NULL,
	[FQty1] [decimal](18, 2) NULL,
	[FPrice1] [decimal](18, 2) NULL,
	[FAcc1] [decimal](18, 2) NULL,
	[FMark1] [varchar](100) NULL,
	[FItem2] [varchar](50) NULL,
	[FUnit2] [varchar](50) NULL,
	[FQty2] [decimal](18, 2) NULL,
	[FPrice2] [decimal](18, 2) NULL,
	[FAcc2] [decimal](18, 2) NULL,
	[FMark2] [varchar](100) NULL,
	[FItem3] [varchar](50) NULL,
	[FUnit3] [varchar](50) NULL,
	[FQty3] [decimal](18, 2) NULL,
	[FPrice3] [decimal](18, 2) NULL,
	[FAcc3] [decimal](18, 2) NULL,
	[FMark3] [varchar](100) NULL,
	[FItem4] [varchar](50) NULL,
	[FUnit4] [varchar](50) NULL,
	[FQty4] [decimal](18, 2) NULL,
	[FPrice4] [decimal](18, 2) NULL,
	[FAcc4] [decimal](18, 2) NULL,
	[FMark4] [varchar](100) NULL,
	[FItem5] [varchar](50) NULL,
	[FUnit5] [varchar](50) NULL,
	[FQty5] [decimal](18, 2) NULL,
	[FPrice5] [decimal](18, 2) NULL,
	[FAcc5] [decimal](18, 2) NULL,
	[FMark5] [varchar](100) NULL,
	[FAmount] [decimal](18, 2) NOT NULL,
	[FUid] [int] NOT NULL,
	[FUName] [varchar](50) NOT NULL,
	[FVid] [int] NULL,
	[FVName] [varchar](50) NULL,
	[FCancel] [int] NOT NULL,
	[FPCount] [int] NOT NULL,
	[FBCode] [varchar](30)
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[Bill_Product] ADD  CONSTRAINT [DF_Bill_Product_FCancel]  DEFAULT ((0)) FOR [FCancel]
GO

ALTER TABLE [dbo].[Bill_Product] ADD  CONSTRAINT [DF_Bill_Product_FPCount]  DEFAULT ((0)) FOR [FPCount]
GO

ALTER TABLE dbo.Bill_Product ADD CONSTRAINT
	PK_Bill_Product PRIMARY KEY CLUSTERED 
	(
	id,
	FBillNo
	) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

GO

